<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<style>td { vertical-align: top; }</style>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
</head><body>

<h1>WYSISWYG HTML to Text Conversion</h1>

<p>
HTML to text function is supposed to be just like the browser
renderer, so that we get WYSISWYG. Here are some example of
some not-so-intutitive cases. They also appear in the unit 
test of <code>FIT::Document::Parser::Text</code>.
</p>

<table border="1" cellpadding="2" cellspacing="2"><tbody><tr>


<!-- whitespace trimmed after BR but not before: aSNb -->

<td>a <br/>   
 b</td>

<!-- also after closing P, but here trimmed also before: aNb -->

<td><p>a  </p>   
 b</td>

<!-- empty p tag is same: aNb -->

<td>a  <p></p>   
b</td>

<!-- is exactly the same: aNb -->

<td>a<p></p>b</td>

<!-- but not any tag: aSbSc -->

<td>a <x>b</x>    
c</td>

<!-- only 2 newlines between a and b: aNNb -->

<td><p>a<br><br></p>b</td>

<!-- aNNNb -->

<td><p>a</p><p><br/><br/></p>b</td>

<!-- aNNNbNc, note how empty P doesn't do anything -->

<td><p>a</p><br/><br/><p>b<br></p>c<p> </p><p>
 </p></td>

<!-- aSSSSSb -->

<td>a  &nbsp;  &nbsp;
  
   b</td>

<!-- aSNNSb -->

<td>a

<br/> <br/>&nbsp;b</td>


<!-- aNSb -->

<td><p>a

</p><p> </p>&nbsp;b</td>

<!-- aNSNSb -->

<td><p>a

</p><p>&nbsp;</p>&nbsp;b</td>

<!-- aSSNN -->

<td>a&nbsp; 
<br/><br/>
‡</td>

<!-- aSNb -->

<td>a
<br/>b</td>

<!-- aSNb -->

<td>a<br/>
b</td>


</tr></tbody></table></body></html>
